<?
	 layout("/inc/win_layout.html",{title:sysTitle}){
    ?>
    <link rel="stylesheet" href="static/uploadify/uploadify.css" type="text/css"></link>
<script type="text/javascript" src="static/uploadify/jquery.uploadify.min.js"></script>
<div class="panel" style="height: 540px; overflow: auto;">
	<div class="panel-body pan" >
		<div class="row" style="margin-bottom: 10px;">
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">用户名
					<span class='require' id="yonghu">*</span> </label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="username" type="text" class="form-control" value="" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">联系人
				<span class='require'></span></label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="contact" type="text" class="form-control" value="" disabled="true"/>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="margin-bottom: 10px;">
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">邮箱
				</label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="email" type="text" class="form-control" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">机构名称
				<span class='require'>*</span></label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="realname" type="text" class="form-control" value="" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">昵称
				</label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="nickname" type="text" class="form-control" value="" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px;display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">头像</label>
				<div class="col-md-9">
					<div class="input-icon">
							<div style= "display:inline " id="single"></div>
							<input id="avatarImg" type="hidden" class="form-control" value="" />
					</div>
				</div>
			</div>
			</div>
			
			<div class="row" style="margin-bottom: 10px;">
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px;display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">手机号
				<span class='require'></span></label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="mobilephone" type="text" class="form-control" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-right:-20px;display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">联系电话
				<span class='require'></span></label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="telephone" type="text" class="form-control" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left;display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">登录方式
					<span class='require'>*</span> </label>
				<div class="col-md-9">
					<div class="input-icon">
						<select id="loginMode" class="form-control" disabled="true">
							<option value="0">用户名和密码</option>
							<option value="1">ip自动登录</option>
						</select>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; margin-left:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">状态
					<span class='require'>*</span> </label>
				<div class="col-md-9">
					<div class="input-icon">
						<select id="status" class="form-control" disabled="true">
							<option value="0">启用</option>
							<option value="1">禁用</option>
						</select>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">用户类型
					<span class='require' id="yonghu">*</span> </label>
				<div class="col-md-9">
					<div class="input-icon">
						<select id="type" class="form-control" disabled="true">
							<option value="1">机构用户</option>
						</select>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left;margin-left:-20px;  display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">秘钥
				</label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="keys" type="text" class="form-control" disabled="true"/>
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">地址
				</label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="address" type="text" class="form-control" value="" disabled="true" />
					</div>
				</div>
			</div>
			<div class="col-lg-6"
				style="width: 400px; float:left;margin-left:-20px;  display:inline; ">
				<label for="inputUsername" class="col-md-3 control-label">备注
				</label>
				<div class="col-md-9">
					<div class="input-icon">
						<textarea rows="2" cols="10" style="color:#999999" id="remarks"
								type="text" class="form-control" disabled="true"></textarea>					</div>
				</div>
			</div>
		</div>
			<div class="row" style="margin-bottom: 10px;">
		<div class="col-lg-12" style=" float:left; margin-left:13px; display:inline;">
				<label for="inputUsername" class="col-xs-12 control-label">账号ip段
				</label>
				<input id="ips" name="ips" type="hidden" class="form-control" value="1;"/>
				<div class="col-xs-3">
					<div class="input-icon" id="startDiv">
						<input id="ipStart_1" name="ipStart_1" type="text" class="form-control" value="" placeholder="起始IP" style="margin-top: 10px;"/>
					</div>
				</div>
				<div class="col-xs-1" style="line-height: 34px;">
					<div class="input-icon" id="ipkey">
						<p style="margin-top: 10px;" id="ipk_1">至</p>
					</div>
				</div>
				<div class="col-xs-3">
					<div class="input-icon" id="endDiv">
						<input id="ipEnd_1" name="ipEnd_1" type="text" class="form-control" value="" placeholder="截止IP" style="margin-top: 10px;"/>
					</div>
				</div>
				<div class="col-xs-2">
		               <!-- <button type="button" data-toggle="dropdown" style="margin-top: 10px;" class="btn btn-success dropdown-toggle" onclick="addIp()">+</button>
		               <button type="button" data-toggle="dropdown" style="margin-top: 10px;" class="btn btn-success dropdown-toggle" onclick="deleteIp()">-</button> -->
				</div>
			</div>
		</div>
		<div class="row" style="margin-bottom: 10px;">
			<div class="col-lg-6"
				style="width: 400px; float:left;  margin-right:-20px; display:inline;">
				<label for="inputUsername" class="col-md-3 control-label">有效期<span class='require'>*</span></label>
				<div class="col-md-9">
					<div class="input-icon">
						<input id="validity" type="text" class="form-control" value="" disabled="true"  onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" />
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?} ?>
<script>
	var index1 = window.parent.getlay();
	$(function() {
		
		if(index1 != 0){
			$.ajax({
			type : "post",
			url : "./listSelect.do",
			data : {
				"id" : index1,
			},
			dataType : "json",
			async : false,
			success : function(data) {
				$("#username").val(data[0].member.username);
				$("#password").val(data[0].member.password);
				$("#nickname").val(data[0].member.nickname);
				$("#realname").val(data[0].member.realname);
				$("#type").val(data[0].member.type);
				$("#createTime").val(data[0].member.createTime);
				$("#createIpAddress").val(data[0].member.createIpAddress);
				$("#avatarImg").val(data[0].member.avatarImg);
				$("#single").html("<img src='"+data[0].member.avatarImg+"' width='30' height='30'/>");
				$("#email").val(data[0].member.email);
				$("#status").val(data[0].member.status);
				$("#mobilephone").val(data[0].member.mobilephone);
				$("#loginMode").val(data[0].member.loginMode);
				$("#keys").val(data[0].member.keys);
				$("#address").val(data[0].member.address);
				$("#telephone").val(data[0].member.telephone);
				$("#validity").val(data[0].member.validity);
				$("#contact").val(data[0].member.contact);
				$("#remarks").val(data[0].member.remarks);
				$("#balancePayment").html("<h4>当前余额："+data[0].member.balance+"&nbsp;&nbsp;&nbsp;&nbsp;支付总金额："+data[0].member.payment+"</h4>");
				for(var i=0;i<data[0].ipLoginNumberList.length;i++){	
					 	var ips = $("#ips").val();
						var ipCount = ips.substr(0,ips.length-1);
						var ipLength=ipCount.length;
						if(i == '0'){
							$("#startDiv").html('<input id="ipStart_1" name="ipStart_'+(ipLength+1)+'" type="text" class="form-control" value="'+data[0].ipLoginNumberList[i].startIpAddressNumber+'" placeholder="起始IP" style="margin-top: 10px;"/>');
							$("#ipkey").html('<p style="margin-top: 10px;" id="ipk_1">至</p>');
							$("#endDiv").html('<input id="ipEnd_1" name="ipEnd_'+(ipLength+1)+'" type="text" class="form-control" value="'+data[0].ipLoginNumberList[i].endIpAddressNmber+'" placeholder="截止IP" style="margin-top: 10px;"/>');
						}else{
							$("#startDiv").append('<input id="ipStart_'+(ipLength+1)+'" name="ipStart_'+(ipLength+1)+'" type="text" class="form-control" value="'+data[0].ipLoginNumberList[i].startIpAddressNumber+'" placeholder="起始IP" style="margin-top: 10px;"/>');
							$("#ipkey").append('<p style="margin-top: 10px;" id="ipk_'+(ipLength+1)+'">至</p>');
							$("#endDiv").append('<input id="ipEnd_'+(ipLength+1)+'" name="ipEnd_'+(ipLength+1)+'" type="text" class="form-control" value="'+data[0].ipLoginNumberList[i].endIpAddressNmber+'" placeholder="截止IP" style="margin-top: 10px;"/>');
							$("#ips").val(ips+(ipLength+1)+";");
						}
					}
			
			},
			error : function(data) {
				alert("请求失败");
			}
		});
		}
	});
	
	function save(){
		var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
	}
	
</script>

